using System;
using System.Collections;
using System.Collections.Generic;
using FrameWork;
using UnityEngine;

namespace PlayerCtrl
{
    

    /// <summary>
    /// MVC Controller层
    /// </summary>
    public class PlayerController : MonoBehaviour
    {
        [Header("玩家UI界面")] [SerializeField] private PlayerView playerView; // 玩家UI界面

        // [SerializeField] private PlayerLvSO lv;                     // 玩家等级配置文件
        private void Awake()
        {
            // Player.Instance.SetLv(lv);
            PlayerModel.Instance.InitInfo();
        }

        //
        private void OnEnable()
        {
            PlayerModel.Instance.AddListener(playerView.UpdateView);

            // 更新视图
            PlayerModel.Instance.UpdateInfo();
        }

        //
        private void OnDisable()
        {
            PlayerModel.Instance.RemoveListener(playerView.UpdateView);
        }
    }
}
